package data;

import javax.swing.ImageIcon;

public class Block {
    String name;                   //名字，比如"雷"或数字
    int aroundMineNumber;          //如果不是类，此数据是周围雷的数目
    ImageIcon mineIcon;            //雷的图标
    public boolean isMine = false;   //是否是雷
    boolean isMark = false;          //是否被标记
    boolean isQuestionMark = false; // 是否被标记为 ？号图标
    boolean isOpen = false;          //是否被挖开
    ViewForBlock blockView;       //方块的视图

    public void setName(String name) {
        this.name = name;
    }

    public void setAroundMineNumber(int n) {
        aroundMineNumber = n;
    }

    public int getAroundMineNumber() {
        return aroundMineNumber;
    }

    public String getName() {
        return name;
    }

    public boolean isMine() {
        return isMine;
    }

    public void setIsMine(boolean b) {
        isMine = b;
    }

    public void setMineIcon(ImageIcon icon) {
        mineIcon = icon;
    }

    public ImageIcon getMineicon() {
        return mineIcon;
    }

    public boolean getIsOpen() {
        return isOpen;
    }

    public void setIsOpen(boolean p) {
        isOpen = p;
    }

    public boolean getIsMark() {
        return isMark;
    }

    public void setIsMark(boolean m) {
        isMark = m;
    }

    public boolean getIsQuestionMark() {
        return isQuestionMark;
    }

    public void setIsQuestionMark(boolean mark) {
        isQuestionMark = mark;
    }

    public void setBlockView(ViewForBlock view) {
        blockView = view;
        blockView.acceptBlock(this);
    }

    public ViewForBlock getBlockView() {
        return blockView;
    }
}
